//
// Copyright (c) 2024 BPer
//
#ifndef SRC_BPERRTP_BPERPUBLISHNACKBUFFER_H_
#define SRC_BPERRTP_BPERPUBLISHNACKBUFFER_H_

#include <bperutil/BPerType.h>

typedef struct BPerSendNackBuffer{
	uint16_t seq;
	int nb;
	char* payload;
}BPerSendNackBuffer;

typedef struct BPerPublishNackBuffer{
	 uint32_t capacityIndex;
	 uint32_t capacity;
	 BPerSendNackBuffer* queue;
}BPerPublishNackBuffer;

#define BPer_Video_Publish_NackBuffer_Count 1024
#define BPer_AUDIO_Publish_NackBuffer_Count 128


#ifdef __cplusplus
extern "C"{
#endif
void bPer_create_pubNackbuffer(BPerPublishNackBuffer* nackbuf,int32_t capacity);
void bPer_destroy_pubNackbuffer(BPerPublishNackBuffer* nackbuf);
void bPer_pubnackbuffer_set(BPerPublishNackBuffer* nackbuf,uint16_t at, char* data,int plen);
BPerSendNackBuffer* bPer_pubnackbuffer_at(BPerPublishNackBuffer* nackbuf,uint16_t seq);
#ifdef __cplusplus
}
#endif
#endif /* SRC_BPERRTP_BPERPUBLISHNACKBUFFER_H_ */
